package com.hantanger.weblog.model;

import java.util.List;

import com.google.appengine.api.datastore.Text;
import com.googlecode.objectify.annotation.Cache;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Ignore;
import com.googlecode.objectify.annotation.Index;

@Cache
@Entity
public class Post {
	
	@Id private Long id;
	
	private String title;
	
	private Text content;
	
	private Text digest;
	
	private String keyword;
	
	private long createTime;
	
	//作者的id
	@Index
	private long authorId;
	
	@Ignore
	private User author;
	
	@Index
	private long publishTime;
	
	@Index
	private long archiveDate;  //归档日年月,用于快速查找某归档下的日志
	
	@Index
	private boolean published;
	
	@Index
	private boolean publiced;
	
	private boolean isSubmit;//是否投稿
	
	private boolean allowComment;
	
	@Index
	private int status;
	
	@Index
	private int rank;
	
	private String moveFrom;
	
	@Index
	private long categoryId;
	
	@Index
	private List<String> tags;
	
	@Ignore
	private PostCount postCount;
	
	@Ignore
	private Category category;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Text getContent() {
		return content;
	}

	public void setContent(Text content) {
		this.content = content;
	}

	public Text getDigest() {
		return digest;
	}

	public void setDigest(Text digest) {
		this.digest = digest;
	}

	public String getKeyword() {
		return keyword;
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}

	public long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}

	public long getPublishTime() {
		return publishTime;
	}

	public void setPublishTime(long publishTime) {
		this.publishTime = publishTime;
	}

	public boolean isPublished() {
		return published;
	}

	public void setPublished(boolean published) {
		this.published = published;
	}

	public boolean isPubliced() {
		return publiced;
	}

	public void setPubliced(boolean publiced) {
		this.publiced = publiced;
	}
	
	public long getArchiveDate() {
		return archiveDate;
	}

	public void setArchiveDate(long archiveDate) {
		this.archiveDate = archiveDate;
	}

	public boolean isAllowComment() {
		return allowComment;
	}

	public void setAllowComment(boolean allowComment) {
		this.allowComment = allowComment;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	public String getMoveFrom() {
		return moveFrom;
	}

	public void setMoveFrom(String moveFrom) {
		this.moveFrom = moveFrom;
	}

	public long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(long categoryId) {
		this.categoryId = categoryId;
	}

	public List<String> getTags() {
		return tags;
	}

	public void setTags(List<String> tags) {
		this.tags = tags;
	}

	public void setPostCount(PostCount postCount) {
		this.postCount = postCount;
	}

	public PostCount getPostCount() {
		return postCount;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public long getAuthorId() {
		return authorId;
	}

	public void setAuthorId(long authorId) {
		this.authorId = authorId;
	}

	public User getAuthor() {
		return author;
	}

	public void setAuthor(User author) {
		this.author = author;
	}

	public boolean isSubmit() {
		return isSubmit;
	}

	public void setSubmit(boolean isSubmit) {
		this.isSubmit = isSubmit;
	}
}

